package org.gourpg.model.log;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import java.sql.Timestamp;


public class SystemRunningLog {

    /**
     * 纯主键ID，多维雪花算法
     */
    private Long logId;
    /**
     * 操作员ID，可能为空，取不到人的时候为空
     */
    private Integer logPersonId;
    /**
     * 开始时间
     */
    private Timestamp logStartTime;
    /**
     * 结束时间
     */
    private Timestamp logEndTime;
    /**
     * 执行功能类型（注解中填写）
     */
    private String logClassType;
    /**
     * 执行功能名称（注释中填写）
     */
    private String logClassName;
    /**
     * 执行功能地址
     */
    private String logClassPath;
    /**
     * 时间间隔(毫秒)
     */
    private Integer logTimeInterval;

    public SystemRunningLog() {
    }

    public SystemRunningLog(Long logId, Integer logPersonId, Timestamp logStartTime, Timestamp logEndTime, String logClassType, String logClassName, String logClassPath, Integer logTimeInterval) {
        this.logId = logId;
        this.logPersonId = logPersonId;
        this.logStartTime = logStartTime;
        this.logEndTime = logEndTime;
        this.logClassType = logClassType;
        this.logClassName = logClassName;
        this.logClassPath = logClassPath;
        this.logTimeInterval = logTimeInterval;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("logId", logId)
                .add("logPersonId", logPersonId)
                .add("logStartTime", logStartTime)
                .add("logEndTime", logEndTime)
                .add("logClassType", logClassType)
                .add("logClassName", logClassName)
                .add("logClassPath", logClassPath)
                .add("logTimeInterval", logTimeInterval)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        SystemRunningLog that = (SystemRunningLog) o;
        return Objects.equal(getLogId(), that.getLogId()) && Objects.equal(getLogPersonId(), that.getLogPersonId()) && Objects.equal(getLogStartTime(), that.getLogStartTime()) && Objects.equal(getLogEndTime(), that.getLogEndTime()) && Objects.equal(getLogClassType(), that.getLogClassType()) && Objects.equal(getLogClassName(), that.getLogClassName()) && Objects.equal(getLogClassPath(), that.getLogClassPath()) && Objects.equal(getLogTimeInterval(), that.getLogTimeInterval());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getLogId(), getLogPersonId(), getLogStartTime(), getLogEndTime(), getLogClassType(), getLogClassName(), getLogClassPath(), getLogTimeInterval());
    }

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public Integer getLogPersonId() {
        return logPersonId;
    }

    public void setLogPersonId(Integer logPersonId) {
        this.logPersonId = logPersonId;
    }

    public Timestamp getLogStartTime() {
        return logStartTime;
    }

    public void setLogStartTime(Timestamp logStartTime) {
        this.logStartTime = logStartTime;
    }

    public Timestamp getLogEndTime() {
        return logEndTime;
    }

    public void setLogEndTime(Timestamp logEndTime) {
        this.logEndTime = logEndTime;
    }

    public String getLogClassType() {
        return logClassType;
    }

    public void setLogClassType(String logClassType) {
        this.logClassType = logClassType;
    }

    public String getLogClassName() {
        return logClassName;
    }

    public void setLogClassName(String logClassName) {
        this.logClassName = logClassName;
    }

    public String getLogClassPath() {
        return logClassPath;
    }

    public void setLogClassPath(String logClassPath) {
        this.logClassPath = logClassPath;
    }

    public Integer getLogTimeInterval() {
        return logTimeInterval;
    }

    public void setLogTimeInterval(Integer logTimeInterval) {
        this.logTimeInterval = logTimeInterval;
    }
}
